# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Jan de Groot <jgc.archlinux.org>
# Contributor: Eric Johnson <eric.archlinux.org>

pkgname=libidn
pkgver=1.33
pkgrel=2
pkgdesc="Implementation of the Stringprep, Punycode and IDNA specifications"
url="https://www.gnu.org/software/libidn/"
arch=('i686' 'x86_64')
license=('GPL3' 'LGPL')
depends=('glibc')
source=(https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz{,.sig}
        gcc7_buildfix.diff)
sha256sums=('44a7aab635bb721ceef6beecc4d49dfd19478325e1b47f3196f7d2acc4930e19'
            'SKIP'
            '1b539ba3916fe8982d596f4de9a65138ae9a35a042e1673328a092a478b7fb33')
validpgpkeys=('9AA9BDB11BB1B99A21285A330664A76954265E8C') # "Simon Josefsson <simon@josefsson.org>"

prepare() {
  cd ${pkgname}-${pkgver}
  # fix build with gcc7
  patch -Np1 -i ../gcc7_buildfix.diff
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
}
package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  # doc html installation - gtk-doc isn't supported anymore - FS#55151
  mkdir -p ${pkgdir}/usr/share/gtk-doc/html/${pkgname}
  cp -r -v doc/reference/html/* ${pkgdir}/usr/share/gtk-doc/html/${pkgname}
}
